<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%request.setAttribute("ctx",request.getContextPath()); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%-- 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">--%>
<title>广州腾码网络资产管理系统</title>
<link href="${ctx}/images/skin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1D3647;
}
-->
.buttomw { 
	BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-SIZE: 12px; BACKGROUND: url(images/buttom_bg.gif) #ffffff fixed no-repeat left 50%; BORDER-LEFT: #999999 1px solid; CURSOR: hand; LINE-HEIGHT: 20px; BORDER-BOTTOM: #999999 1px solid; HEIGHT: 22px 
} 
</style>


<script type="text/javascript">
	function correctPNG()
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) 
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}

window.attachEvent("onload", correctPNG);

	function login(){
		var userName = document.getElementById("userName").value;
		var password = document.getElementById("password").value;
		if(userName == "" || password == ""){
			alert("尊敬的用户，请输入用户名和登陆密码!");
			return;
		}
		var form0 = document.getElementById("loginForm");
		form0.action = "${ctx}/admin/userLogin";
		form0.method = "post";
		form0.submit();
    }
    function alertMsg(){
    	var errorMsg = "${message}";
    	if(errorMsg != ""){
    		alert(errorMsg);
    	}
    }
    alertMsg();

/* Added by Doug for '取消' button */
 
    function isObject(obj){
        if (obj != null && typeof(obj) != "undefined")
            return true;
        else
            return false;
    }
    
   /* Creates the fade background */
   function createBgDiv(id){
	    if (!isObject(id))
	        id = "backgroundDiv";
	      
	    offHeight = window.screen.height;
	    offWidth = window.screen.width;
	    var div = document.createElement("DIV");
	    div.id = id;
	    div.style.left = 0;
	    div.style.top = 0;
	    div.style.width="100%";
	    div.style.height = document.body.scrollHeight;
	    /* div.style.width = offWidth;
	    div.style.height = document.body.scrollHeight; */
	    div.style.position = "absolute";
	    div.style.display = "";
	    div.style.zIndex = "999";
	    div.style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
	    div.style.backgroundColor="#777";
	    document.body.appendChild(div);
	    hideSelectForm();
	   
	    fadeBg(10, id);
	   
	    return div;
	}
   </script>
   
   <div id="logoutInfoDiv" style="display:none; "></div>
    <script language="javascript">
   function showConfirmMsg1(){
	   	
	   if (!isObject(document.getElementById("logoutDiv")))
		    createBgDiv("logoutDiv");
		 
		var infoDiv = document.getElementById("logoutInfoDiv");

		infoDiv.innerHTML = generateConfirmLogoutMsg();

		/* Style for the overlay */
		with(infoDiv.style){
		    zIndex = 1000;
		    position = "absolute";
		    width = "300px";
		    /* top = (document.body.offsetHeight-150)/2 + document.body.scrollTop;
		    left = (document.body.offsetWidth-400)/2; */
		    /* top = "40%";
		    left = "28%";  */
		    border = "1px #4372A5 solid";
		    padding = "10px";
		    backgroundColor = "#ffffff";
		    filter = "Alpha(Opacity=90)";
		    display = "block";
		}	
	   
	   return;                                  
   }
   
   function generateConfirmLogoutMsg(){
  	   var msg = "";
  	  
  	   msg += '<table width="400"  border="0" cellspacing="0" cellpadding="0" >';
  	   msg += '<tr>';
  	   msg += '<td bgcolor="DEE8F3" class="Bold_font" height="30">确认退出</td>';
  	   msg += '</tr>';
  	   msg += '<tr>';
  	   msg += '<td align="left" >&nbsp;</td>';
  	   msg += '</tr>';
  	   msg += '</table>';
  	   msg += '<table width="400"  border="0" cellspacing="0" cellpadding="0" >';
  	   msg += '<tr>';
  	   msg += '<td class="register" height="30" align="left">Are you sure?</td>';
  	   msg += '</tr>';
  	   msg += '<tr>';
  	   msg += '<td align="center" >';
  	   msg += '<input id="submitB" type="submit" value="退出" name="input" class="buttom" onclick="forceLogout()"';
  	   /* msg += '<input id="submitB" type="submit" value="退出" name="input" class="buttomw" onclick="window.location=/';
  	   msg += 'www.google.com /';*/
  	   msg += '"> &nbsp;&nbsp;&nbsp;'; 
  	   msg += '<input type="button" value="取消" name="input" class="buttom" onclick="cancelLogout()">';
  	   msg += '</td>';
  	   msg += '</tr>';
  	   msg += '</table>';
  	  
  	   return msg;
  	}
   
   function forceLogout(){
	   /* window.opener=null;
	   window.open('', '_self');
	   window.close(); */
	   
	   if (navigator.userAgent.indexOf("MSIE") > 0) {  
           if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {  
               window.opener = null; window.close();  
           }  
           else {  
               window.open('', '_top'); window.top.close();  
           }  
       }  
       else if (navigator.userAgent.indexOf("Firefox") > 0) {  
           window.location.href = 'about:blank ';  
           //window.history.go(-2);   
       }  
       else {  
           window.opener = null;   
           window.open('', '_self', '');  
           window.close();  
       }  
	   
	   return;
	}
   
   function cancelLogout(){
	     var aa = document.getElementById("logoutDiv");
	     var infoDiv = document.getElementById("logoutInfoDiv");
	         infoDiv.style.display = "none";
	    
	     if (isObject(aa))
	         document.body.removeChild(aa);    
	    
	     showSelectForm();
	}
   
   function hideSelectForm(){
       var opts = document.getElementsByTagName("SELECT");
       if (opts == null || typeof(opts) == "undefined")
           return ;
          
       for (var i=0; i<opts.length; i++){
           opts[i].style.visibility = "hidden";
       }
   }
   
   function showSelectForm(){
       var opts = document.getElementsByTagName("SELECT");
       if (opts == null || typeof(opts) == "undefined")
           return ;
          
       for (var i=0; i<opts.length; i++){
          
           opts[i].style.visibility = "visible";
       }
   }
   
   function fadeBg(index, str){
       var obj = document.getElementById(str);
       obj.style.filter = "alpha(Opacity=" + index + ")";
      
       /* Controls how quick the fade-out happens */
       if (index < 50)
           window.setTimeout("fadeBg(" + (index+5) + ", '" + str + "')", 150);
      
   }
   
/* Doug's code ends here */
</script>
</head>

<bodygin-bg.gif">
<form action="" id="loginForm">
	<table width="100%" height="166" border="0" cellpadding="0"
		cellspacing="0">
		<tr>
			<td height="42" valign="top"><table width="100%" height="42"
					border="0" cellpadding="0" cellspacing="0" class="login_top_bg">
					<tr>
						<td width="1%" height="21">&nbsp;</td>
						<td height="42">&nbsp;</td>
						<td width="17%">&nbsp;</td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td valign="top"><table width="100%" height="532" border="0"
					cellpadding="0" cellspacing="0" class="login_bg">
					<tr>
						<td width="49%" align="right"><table width="91%" height="532"
								border="0" cellpadding="0" cellspacing="0" class="login_bg2">
								<tr>
									<td height="138" valign="top"><table width="89%"
											height="427" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td height="149">&nbsp;</td>
											</tr>
											
											<tr>
												<td height="80" align="right" valign="top"><img
													src="${ctx}/images/Tenmark/Tenmark_Title.bmp" width="279" height="68"></td>
											</tr>
											
											<tr>
												<td height="198" align="right" valign="top"><table
														width="100%" border="0" cellpadding="0" cellspacing="0">

														<tr>
															<td>&nbsp;</td>
															<td width="30%" height="40" align="right"><img
																src="${ctx}/images/icon-demo.gif" width="16" height="16"><a
																href="http://www.baidu.com" target="_blank"
																class="left_txt3"> TBD</a></td>
																<!-- class="left_txt3"> 使用说明</a></td> -->
															<td width="35%" align="right"><img
																src="${ctx}/images/icon-login-seaver.gif" width="16"
																height="16"><a href="http://www.baidu.com"
																class="left_txt3"> TBD</a></td>
																<!-- class="left_txt3"> 在线客服</a></td> -->
														</tr>
													</table></td>
											</tr>
										</table></td>
								</tr>

							</table></td>
						<td width="1%">&nbsp;</td>
						<td width="50%" valign="bottom"><table width="100%"
								height="59" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td width="4%">&nbsp;</td>
									<td width="96%" height="38"><span class="login_txt_bt">广州腾码网络资产管理系统</span></td>
								</tr>
								<tr>
									<td>&nbsp;</td>
									<td height="21"><table cellSpacing="0" cellPadding="0"
											width="100%" border="0" id="table211" height="328">
											<tr>
												<td height="164" colspan="2" align="middle"><form
														name="myform" action="index.html" method="post">
														<table cellSpacing="0" cellPadding="0" width="100%"
															border="0" height="143" id="table212">
															<tr>
																<td width="13%" height="38" class="top_hui_text"><span
																	class="login_txt">用户名：&nbsp;&nbsp; </span></td>
																<!-- <td height="38" colspan="2" class="top_hui_text"><input
																	name="userName" id="userName" class="editbox4"
																	value="system" size="20"></td> -->
																<td height="38" colspan="2" class="top_hui_text"><input
																	name="userName" id="userName" class="editbox4"
																	size="20"></td>	
															</tr>
															<tr>
																<td width="13%" height="35" class="top_hui_text"><span
																	class="login_txt"> 密 码： &nbsp;&nbsp; </span></td>
																<%-- <td height="35" colspan="2" class="top_hui_text"><input
																	class="editbox4" type="password" size="20"
																	name="password" id="password" value="system"> <img
																	src="${ctx}/images/luck.gif" width="19" height="18">
																</td> --%>
																<td height="35" colspan="2" class="top_hui_text"><input
																	class="editbox4" type="password" size="20"
																	name="password" id="password" > <img
																	src="${ctx}/images/luck.gif" width="19" height="18">
																</td>
															</tr>
															<%-- 
                          <tr>
                            <td width="13%" height="35" ><span class="login_txt">验证码：</span></td>
                            <td height="35" colspan="2" class="top_hui_text"><input class=wenbenkuang name=verifycode type=text value="" maxLength=4 size=10>
                              </td>
                          </tr>
                           --%>
															<tr>
																<td height="35">&nbsp;</td>
																<td width="20%" height="35"><input name="Submit"
																	type="submit" onclick="login();" class="button"
																	id="Submit" value="登 录"></td>
																<td width="67%" class="top_hui_text"><input
																	name="cs" type="button" class="button" id="cs"
																	value="取 消" onClick="showConfirmMsg1()"></td>
															</tr>
														</table>
														<br>
													</form></td>
											</tr>
											<tr>
												<td width="433" height="164" align="right" valign="bottom"><img
													src="${ctx}/images/login-wel.gif" width="242" height="138"></td>
												<td width="57" align="right" valign="bottom">&nbsp;</td>
											</tr>
										</table></td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td height="20"><table width="100%" border="0" cellspacing="0"
					cellpadding="0" class="login-buttom-bg">
					<tr>
						<td align="center"><span class="login-buttom-txt">Copyright
								&copy; 2012-2013 ATech</span></td>
					</tr>
				</table></td>
		</tr>
	</table>
</form>
</body>
</html>


